﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Hi_Baidu.Cache.CacheObject
{
    public class PopPictureCache : Cache
    {
        public PopPictureCache(String Key, String Value, DateTime ExpridTime, PopType PictureType)
            : base(Key, Value, ExpridTime)
        {
            this.pictureType = PictureType;
        }

        private PopType pictureType;

        /// <summary>
        ///     提取类型
        /// </summary>
        public PopType PictureType
        {
          get { return pictureType; }
        }

        public enum PopType
        {
            /// <summary>
            ///     文件类型
            /// </summary>
            File,
            /// <summary>
            ///     流类型
            /// </summary>
            Stream
        }

        private Bitmap pictureStream;
        /// <summary>
        ///     图片流
        /// </summary>
        public Bitmap PictureStream
        {
            get { return pictureStream; }
            set { pictureStream = value; }
        }

        private String ext;
        /// <summary>
        ///     后缀名
        /// </summary>
        public String Ext
        {
            get { return ext; }
            set { ext = value; }
        }
        private String filename;
        /// <summary>
        ///     文件名
        /// </summary>
        public String Filename
        {
            get { return filename; }
            set { filename = value; }
        }

        public override void Dispose()
        {
            DeclareCacheManager.popPictureCacheManager.Remove(this);
        }
    }
}
